<template>
	<div class="toplamList">
		<div class="toplam" v-for="(item, index) in list" :key="index"
			:style="{'background-image': `url(${item.image})`}" @click="gomazmun(item)">
			<div class="left">
				<swiper :indicator-dots="false" circular :autoplay="true" :interval="1000" :duration="200"
					class="my-swiper" v-if="item.info.length">
					<block v-for="(obj, j) in item.info" :key="j">
						<swiper-item>
							<view class="swiper-item">
								<image @click="goview(obj)" mode="aspectFill" :src="obj.image" class="img" />
							</view>
						</swiper-item>
					</block>
				</swiper>
			</div>
			<div class="right">
				<div class="top"></div>
				<div class="text">
					{{item.title}}
				</div>
				<div class="bottom"></div>
			</div>
		</div>
	</div>
</template>

<script>
	export default {
		props: {
			list: {
				type: Array,
				default: () => [],
			},
		},
		data() {
			return {

			}
		},
		mounted() {

		},
		methods: {
			gomazmun(item) {
				uni.navigateTo({
					url: '/pages/mazmun/index?id=' + item.id
				})
			},
			goview(item) {
				uni.navigateTo({
					url: "/pages/view/index?id=" + item.id
				})
			}
		},
	}
</script>

<style lang="scss" scoped>
	.toplamList {
		.toplam {
			height: 175px;
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 0 20px 0 12px;
			background-size: 100% 100%;
			filter: contrast(100%);

			.left {
				width: 100px;

				.my-swiper {
					width: 100px;
					height: 150px;
					border-radius: 5px;
					overflow: hidden;

					.img {
						width: 100%;
						height: 150px;
					}
				}
			}

			.right {
				width: 210px;

				.top,
				.bottom {
					height: 10px;
					border-radius: 8px;
					background-image: linear-gradient(45deg, #b8b6b600 0%, #fffefb46 100%);
				}

				.bottom {
					background-image: linear-gradient(45deg, #fffefb46 0%, #b8b6b600 100%);
				}

				.text {
					color: #fff;
					font-size: 14px;
					white-space: nowrap;
					width: 100%;
					overflow: hidden;
					text-overflow: ellipsis;
					direction: rtl;
					margin: 8px 0;
				}
			}
		}
	}
</style>